#ifndef __UTILS_H__
#define __UTILS_H__

#define GBK2UNI_FILE "/resource/gbk2uni.tbl"
#define UNI2GBK_FILE "/resource/uni2gbk.tbl"

void ff_convert_init(void);

void fn2name(char* fn, char* buffer);
void fn2folder(char* fn, char* buffer);

int media_type(const char *fn);
char *strncasestr(const char *haystack, const char *needle);

rt_uint32_t read_line(int fd, char *line, rt_uint32_t line_size);
rt_bool_t is_directory(const char *path);
rt_uint32_t get_filesize(int fd);
rt_uint32_t rt_ftell(int fd);
rt_uint8_t get_path_depth(const char* fn);
rt_bool_t res_copy(const char *src, const char *dst);
rt_bool_t res_update(void);

void draw_string(rt_uint16_t x,rt_uint16_t y,rt_uint8_t*str, rt_uint16_t color, rt_uint16_t b_color,rt_uint8_t mode);
void iamge_draw_jpeg(char* fn, rt_uint16_t x, rt_uint16_t y);
void iamge_draw_bmp(char* fn, rt_uint16_t x, rt_uint16_t y);
void iamge_draw_hdc(rt_uint32_t icon_pos, rt_uint16_t x, rt_uint16_t y);
void iamge_draw_hdc_icon(rt_uint32_t icon_pos, rt_uint16_t x, rt_uint16_t y);
char *string_cyclicshift_v2( char *string, int i );
int file_type(const char *path);
rt_uint32_t rt_tell(int fd);
rt_bool_t is_exist(const char *path);
rt_uint16_t get_adc_value(void);
void rt_hw_adc_init(void);
void power_ctrl(rt_uint8_t mode);
void player_set_volume(rt_uint8_t vol);
#endif
